//back to welcome
function goWelcome(){
	window.location="/main/login/welcome.htm";	
}


function addLoadEvent(func) {   
  var oldonload = window.onload;   
  if (typeof window.onload != 'function') {   
    window.onload = func;   
  } else {   
    window.onload = function() {   
      oldonload();   
      func();   
    }   
  }   
} 

/** order */
/*<a href='#' onClick="order(this);" class="order" oName="o_number" oValue="<?=nn(gain("o_number"))?>">编号</a>*/
function order(atag){
	var str;
	str=eval("document.form1."+atag.oName+".value");
	if(str==""){		
		eval("document.form1."+atag.oName+".value='asc';");		
	}else if(str=="asc"||str=="ASC"){
		eval("document.form1."+atag.oName+".value='desc';");		
	}else if(str=="desc"||str=="DESC"){
		eval("document.form1."+atag.oName+".value='';");			
	}
	document.form1.submit();
}

addLoadEvent(function(){
				var as=document.getElementsByTagName("A");
				var i,temp;
				for(i=0;i<as.length;i++)
					if(as[i].className=="order"){
						as[i].style.color="#ff6666";									
						temp="<INPUT type=hidden name='"+as[i].oName+"' value='"+as[i].oValue+"' />";
//						alert(temp);
						if(as[i].oValue=="asc"){
							as[i].innerHTML+="&nbsp;&uarr;";
						}else if(as[i].oValue=="desc"){
							as[i].innerHTML+="&nbsp;&darr;";
						}						
						form1.innerHTML+=temp;
//						alert(form1.o_number.value);
					}											
			  });